<!DOCTYPE html>
<html>
	<head>
		<tal:block metal:use-macro="../macros.tpl.php/headScripts" />
	</head>
	<body>
		<div id='container'>
			<h1>${title}</h1>
			<tal:block tal:condition="exists: team">
				<table align="center">
					<thead>
						<tr align="center">
							<th colspan="3">${team/name} - Team Members</th>
						</tr>
						<tr>
							<th>Name</th>
							<th>Status</th>
							<th>Joined</th>
						</tr>
					</thead>
					<tbody>
						<tal:block>
							<tr tal:repeat="member team/members">
								<td>${member/name}</td>
								<td>${member/status}</td>
								<td>${member/joined}</td>
							</tr>
						</tal:block>
					</tbody>
				</table>
				<p></p>
			</tal:block>

			<tal:block tal:condition="exists: addTeam">
				<form method="post">
					<table align="center">
						<thead>
							<tr align="center"><th colspan="2">Add Team</th></tr>
						</thead>
						<tbody>
							<tr>
								<td>Name:</td>
								<td><input name="title" type="text" placeholder="Enter Team Name" /></td>
							</tr>
							<tr>
								<td>About:</td>
								<td><input name="description" type="text" placeholder="Enter About Team" /></td>
							</tr>
							<tr>
								<td>Team Members<sub>(Invite your friends by email)</sub>:</td>
								<td><input name="emails" type="text" placeholder="Emails comma saparated" /></td>
							</tr>
							<tr>
								<td colspan="2" align="center"><button name="addTeamBtn" type="submit">Save</button></td>
							</tr>
						</tbody>
						<tfoot tal:condition="message">
							<tr align="center">
								<td colspan="2" style="color:red;font-weight: bold;">${message}</td>
							</tr>
						</tfoot>
					</table>
				</form>
				<p></p>
			</tal:block>

			<table align="center">
				<thead>
					<tr>
						<th>Team Name</th>
						<th>Description</th>
						<th>Status</th>
						<th>Total Members</th>
					</tr>
				</thead>
				<tbody>
					<tal:block tal:condition="teams">
						<tr tal:repeat="team teams">
							<td><a href="${team/link}">${team/name}</a></td>
							<td>${team/desc}</td>
							<td>${team/status}</td>
							<td>${team/members}</td>
						</tr>
					</tal:block>
					<tfoot>
						<tr>
							<td colspan="4"><a href="/admin/teams/nv/new/true/">Add New</a></td>
						</tr>
					</tfoot>
				</tbody>
			</table>

		</div>
	</body>
</html>
